package com.mt.restaurant.entity.sale;

import javax.persistence.*;
import java.io.Serializable;
import com.mt.common.core.annotation.DColumn;
import com.mt.common.core.annotation.DEntity;
import com.mt.common.core.web.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;



import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import com.mt.restaurant.entity.sale.SaleOrder;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@DEntity(label="销售订单结算",comment="",moduleLabel="销售管理")
@Entity(name="restaurant_sale_order_settlement")
@Table(name = "restaurant_sale_order_settlement" , indexes = { @Index(name = "index_sale_order_id", columnList = "sale_order_id")  })
@ApiModel(description = "销售订单结算:")
public class SaleOrderSettlement extends BaseEntity implements Serializable{
	private static final long serialVersionUID = 1L;

	@DColumn(index=3,label="销售订单",foreignEntity="SaleOrder",comment="销售订单",component="对象选择",where=false)
	@ApiModelProperty(value = "销售订单:销售订单")
	@Column(name="sale_order_id",length=255,nullable=false,unique=false)
	private Long saleOrderId;

	@Transient
	private SaleOrder saleOrder;

	@Transient
	@ApiModelProperty(value = "销售订单名称:销售订单")
	@DColumn(index=3,label="销售订单",foreignEntity="SaleOrder",comment="销售订单")
	private String saleOrderName;

	@DColumn(index=4,label="结算价格",comment="结算价格",component="数字，小数",where=false)
	@ApiModelProperty(value = "结算价格:结算价格")
	@Column(name="settl_price",length=255,nullable=false,unique=false)
	private Double settlPrice;

	@DColumn(index=5,label="结算时间",comment="结算时间",component="日期选择",where=false)
	@ApiModelProperty(value = "结算时间:结算时间")
	@Column(name="settl_date",length=255,nullable=true,unique=false)
	@JsonSerialize(using = DateSerializer.class)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date settlDate;

	@DColumn(index=6,label="流水号",comment="",component="文本",where=false)
	@ApiModelProperty(value = "流水号:")
	@Column(name="serial_num",length=255,nullable=false,unique=false)
	private String serialNum;

	@DColumn(index=7,label="付款人",comment="",component="文本",where=false)
	@ApiModelProperty(value = "付款人:")
	@Column(name="payer",length=255,nullable=true,unique=false)
	private String payer;

	@DColumn(index=7,label="付款方式",comment="",component="文本",where=false)
	@ApiModelProperty(value = "付款方式:")
	@Column(name="pay_method",length=255,nullable=true,unique=false)
	private String payMethod;

	public String getPayMethod() {
		return payMethod;
	}

	public void setPayMethod(String payMethod) {
		this.payMethod = payMethod;
	}

	public Long getSaleOrderId() {
		return this.saleOrderId;
	}

	public void setSaleOrderId(Long saleOrderId) {
		this.saleOrderId = saleOrderId;
	}

	public Double getSettlPrice() {
		return this.settlPrice;
	}

	public void setSettlPrice(Double settlPrice) {
		this.settlPrice = settlPrice;
	}

	public Date getSettlDate() {
		return this.settlDate;
	}

	public void setSettlDate(Date settlDate) {
		this.settlDate = settlDate;
	}

	public String getSerialNum() {
		return this.serialNum;
	}

	public void setSerialNum(String serialNum) {
		this.serialNum = serialNum;
	}

	public String getPayer() {
		return this.payer;
	}

	public void setPayer(String payer) {
		this.payer = payer;
	}

	public SaleOrder getSaleOrder() {
		return this.saleOrder;
	}

	public void setSaleOrder(SaleOrder saleOrder) {
		if(saleOrder == null){
		}
		else
		{
		this.saleOrderId = saleOrder.getEid();
		this.saleOrder = saleOrder;		
		}
}

	public String getSaleOrderName() {
		return this.saleOrderName;
	}

	public void setSaleOrderName(String saleOrderName) {
		this.saleOrderName = saleOrderName;
	}



}
